<html>
<head>
	<meta charset="UTF-8">
	<meta content="IE=edge" http-equiv="X-UA-Compatible">
	<meta content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width" name="viewport">
	<title>4307：Maishroom & Class</title>
	<!-- css -->
	<link href="../css/base.min.css" rel="stylesheet">
	<link href="../css/project.min.css" rel="stylesheet">
	
	<!-- favicon -->
	<!-- ... -->
</head>
<body class="page-brand">
	<header class="header header-transparent header-waterfall ui-header">
		<ul class="nav nav-list pull-left">
			<li>
				<a data-toggle="menu" href="#menu">
					<span class="icon icon-lg">menu</span>
				</a>
			</li>
		</ul>
		<a class="header-logo header-affix-hide margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">Maishroom & Class</a>
		<span class="header-logo header-affix margin-left-no margin-right-no" data-offset-top="213" data-spy="affix">Maishroom & Class</span>
	</header>
	<nav aria-hidden="true" class="menu" id="menu" tabindex="-1">
		<div class="menu-scroll">
			<div class="menu-content">
				<a class="menu-logo" href="../index.html">BZOJ离线题库</a>
				<ul class="nav">
					<li>
						<a class="waves-attach" data-toggle="collapse" href="#problems">题目</a>
						<ul class="menu-collapse collapse in" id="problems">
							<li>
								<a class="waves-attach" href="../index.html">主页</a>
							</li>
							<li>
								<a class="waves-attach" href="../list.html">题目列表</a>
							</li>
						</ul>
					</li>
					<li>
						<a class="collapsed waves-attach" data-toggle="collapse" href="#about">关于</a>
						<ul class="menu-collapse collapse" id="about">
							<li>
								<a class="waves-attach" href="../about.html">关于此项目</a>
							</li>
						</ul>
					</li>
					
				</ul>
			</div>
		</div>
	</nav>
	<main class="content">
		<div class="content-header ui-content-header">
			<div class="container">
				<h1 class="content-heading">
                Maishroom & Class                </h1>
                <p>时间限制：25s&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  空间限制：256MB</p>			</div>
		</div>
		<div class="container">
			<section class="content-inner margin-top-no">
				<div class="row">
					<div class="col-lg-13 col-md-13">
						<div class="card margin-bottom-no">
							<div class="card-main">
								<div class="card-inner">
									
                                <h3>题目描述</h3><p><div>Maishroom在全国各地开设了OI辅导班，比如四川班等等。Maishroom的辅导班有两种讲师，也就是助教（主要是机房里其他小伙伴）和教师（主要是Maishroom自己）。当一个助教去打vp的时候，显然他就不能授课了，不过没有关系，因为只是助教。当一个教师A（例如Maishroom）去打（看）vp（片）的时候，他需要找另一个讲师B来代替自己的授课。如果B也是教师，他也需要另一个讲师C来代替自己，依次类推。</div>
<div>现在我们需要知道：</div>
<div>1）有多少个讲师不能去打vp。</div>
<div>2）有多少对讲师（A,B），单独地，每个人都可以去打vp，然而不能一起打（开）vp（黑）。</div>
<p></p></p><hr/><h3>输入格式</h3><p><div>第一行，两个整数N, K。分别表示：辅导班里的讲师数与教师数。</div>
<div>约定：编号1~K的为教师，编号K+1~N的为助教。</div>
<div>以下K行，表示各个教师可以被哪些讲师替代。</div>
<div>第i+1行，第一个整数Di，代表可代替教师i的讲师数，之后Di个整数为其编号。</div>
<p></p></p><hr/><h3>输出格式</h3><p><div>一行，两个整数。分别代表两问的答案。</div>
<div></div>
<p></p></p><hr/><h3>样例输入</h3><pre>7 5
2 6 7
1 7
2 2 7
1 5
1 4
</pre><hr/><h3>样例输出</h3><pre>2 3</pre><hr/><h3>提示</h3><p><div>教师4, 5不能去打vp。因为剩下一个人不能做两个人的事。</div>
<div>当教师2, 3开黑的时候，讲师7不可能同时顶替他们两个人。</div>
<div>事实上，(2, 3), (2, 7), (3, 7)都满足，可以单独vp，不能一起开黑。</div>
<div><span style="font-size:10.5pt;line-height:115%;
font-family:微软雅黑;mso-ascii-font-family:Consolas;mso-hansi-font-family:Consolas;
mso-bidi-font-family:Consolas;mso-ansi-language:EN-US;mso-fareast-language:
ZH-CN;mso-bidi-language:AR-SA">对于</span><span lang="EN-US" style="font-size:10.5pt;
line-height:115%;font-family:Consolas;mso-fareast-font-family:微软雅黑;mso-bidi-font-family:
Consolas;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:
AR-SA">100%</span><span style="font-size:10.5pt;line-height:115%;font-family:
微软雅黑;mso-ascii-font-family:Consolas;mso-hansi-font-family:Consolas;mso-bidi-font-family:
Consolas;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:
AR-SA">的数据：</span><span lang="EN-US" style="font-size:10.5pt;line-height:115%;
font-family:Consolas;mso-fareast-font-family:微软雅黑;mso-bidi-font-family:Consolas;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">1</span><span style="font-size:10.5pt;line-height:115%;font-family:微软雅黑;mso-ascii-font-family:
Consolas;mso-hansi-font-family:Consolas;mso-bidi-font-family:Consolas;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">&le;</span><span lang="EN-US" style="font-size:10.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:微软雅黑;mso-bidi-font-family:Consolas;mso-ansi-language:
EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">K</span><span style="font-size:10.5pt;line-height:115%;font-family:微软雅黑;mso-ascii-font-family:
Consolas;mso-hansi-font-family:Consolas;mso-bidi-font-family:Consolas;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">&le;</span><span lang="EN-US" style="font-size:10.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:微软雅黑;mso-bidi-font-family:Consolas;mso-ansi-language:
EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">N</span><span style="font-size:10.5pt;line-height:115%;font-family:微软雅黑;mso-ascii-font-family:
Consolas;mso-hansi-font-family:Consolas;mso-bidi-font-family:Consolas;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">&le;</span><span lang="EN-US" style="font-size:10.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:微软雅黑;mso-bidi-font-family:Consolas;mso-ansi-language:
EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">5,000</span><span style="font-size:10.5pt;line-height:115%;font-family:微软雅黑;mso-ascii-font-family:
Consolas;mso-hansi-font-family:Consolas;mso-bidi-font-family:Consolas;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">，</span><span lang="EN-US" style="font-size:10.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:微软雅黑;mso-bidi-font-family:Consolas;mso-ansi-language:
EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">1</span><span style="font-size:10.5pt;line-height:115%;font-family:微软雅黑;mso-ascii-font-family:
Consolas;mso-hansi-font-family:Consolas;mso-bidi-font-family:Consolas;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">&le;</span><span lang="EN-US" style="font-size:10.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:微软雅黑;mso-bidi-font-family:Consolas;mso-ansi-language:
EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">M</span><span style="font-size:10.5pt;line-height:115%;font-family:微软雅黑;mso-ascii-font-family:
Consolas;mso-hansi-font-family:Consolas;mso-bidi-font-family:Consolas;
mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">&le;</span><span lang="EN-US" style="font-size:10.5pt;line-height:115%;font-family:Consolas;
mso-fareast-font-family:微软雅黑;mso-bidi-font-family:Consolas;mso-ansi-language:
EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA">20,000</span></div>
<p></p></p><hr/><h3>题目来源</h3><p>没有写明来源</p>
								</div>
							</div>
						</div>
					</div>
				</div>
				
				
			</section>
		</div>
	</main>

	<div class="fbtn-container">
		<div class="fbtn-inner">
			<a class="fbtn fbtn-lg fbtn-brand-accent waves-attach waves-circle waves-light waves-effect" data-toggle="dropdown" aria-expanded="true"><span class="fbtn-text fbtn-text-left">Menu</span><span class="fbtn-ori icon">apps</span><span class="fbtn-sub icon">close</span></a>
			<div class="fbtn-dropup">
				<a class="fbtn fbtn-brand waves-attach waves-circle waves-light waves-effect" href="../list.html" target="_self"><span class="fbtn-text fbtn-text-left">题目列表</span><span class="icon">menu</span></a>
				<a class="fbtn fbtn-green waves-attach waves-circle waves-effect" href="../index.html" target="_self"><span class="fbtn-text fbtn-text-left">返回主页</span><span class="icon">home</span></a>
				<a class="fbtn waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/submitpage.php?id=4307" target="_blank"><span class="fbtn-text fbtn-text-left">提交代码</span><span class="icon">send</span></a>
				<a class="fbtn fbtn-orange waves-attach waves-circle waves-effect" href="http://www.lydsy.com/JudgeOnline/wttl/wttl.php?pid=4307" target="_blank"><span class="fbtn-text fbtn-text-left">试题讨论</span><span class="icon">chat</span></a>
				
			</div>
		</div>
	</div>

	<!-- js -->
	<script src="../js/jquery.min.js"></script>
	<script src="../js/base.min.js"></script>
	<script src="../js/project.min.js"></script>
</body>
</html>